From 9d72f811eebe7b18d77f8327b86568ff5a6a4789 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Fri, 28 Jul 2000 00:16:17 +0000 Subject: [PATCH] Part 2 of previous commit (aka "it compiles now, ma") Part 2 of previous commit (aka "it compiles now, ma") --- gdk-pixbuf/gdk-pixbuf-io.c | 2 +- gdk-pixbuf/gdk-pixbuf-loader.c | 4 ++-- gdk-pixbuf/io-wbmp.c | 27 ++++++++++++++------------- gtk/gdk-pixbuf-loader.c | 4 ++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index ff9bc03080..a063f4d41e 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -195,7 +195,7 @@ static GdkPixbufModule file_formats [] = { { "ras", pixbuf_check_sunras, NULL, NULL, NULL, NULL, NULL, NULL }, { "ico", pixbuf_check_ico, NULL, NULL, NULL, NULL, NULL, NULL }, { "bmp", pixbuf_check_bmp, NULL, NULL, NULL, NULL, NULL, NULL }, - { "wbmp", pixbuf_check_wbmp, NULL, NULL, NULL, NULL, NULL, NULL } + { "wbmp", pixbuf_check_wbmp, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c index 63302937b9..c6ae8e2f21 100644 --- a/gdk-pixbuf/gdk-pixbuf-loader.c +++ b/gdk-pixbuf/gdk-pixbuf-loader.c @@ -399,7 +399,7 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader, if (priv->header_buf_offset >= LOADER_HEADER_SIZE) { - if (gdk_pixbuf_loader_load_module (loader) == 0) + if (gdk_pixbuf_loader_load_module (loader, NULL) == 0) return 0; } @@ -563,7 +563,7 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader) /* We have less the 128 bytes in the image. Flush it, and keep going. */ if (priv->image_module == NULL) - gdk_pixbuf_loader_load_module (loader); + gdk_pixbuf_loader_load_module (loader, NULL); if (priv->image_module && priv->image_module->stop_load) priv->image_module->stop_load (priv->context); diff --git a/gdk-pixbuf/io-wbmp.c b/gdk-pixbuf/io-wbmp.c index 05949faead..4b7dced9f9 100644 --- a/gdk-pixbuf/io-wbmp.c +++ b/gdk-pixbuf/io-wbmp.c @@ -79,7 +79,7 @@ GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f) { size_t length; char membuf[4096]; - struct bmp_progressive_state *State; + struct wbmp_progressive_state *State; GdkPixbuf *pb; @@ -98,7 +98,7 @@ GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f) pb = State->pixbuf; - gdk_pixbuf__bmp_image_stop_load(State); + gdk_pixbuf__wbmp_image_stop_load(State); return pb; } @@ -115,9 +115,9 @@ gdk_pixbuf__wbmp_image_begin_load(ModulePreparedNotifyFunc prepared_func, ModuleAnimationDoneNotifyFunc anim_done_func, gpointer user_data) { - struct bmp_progressive_state *context; + struct wbmp_progressive_state *context; - context = g_new0(struct bmp_progressive_state, 1); + context = g_new0(struct wbmp_progressive_state, 1); context->prepared_func = prepared_func; context->updated_func = updated_func; context->user_data = user_data; @@ -136,8 +136,8 @@ gdk_pixbuf__wbmp_image_begin_load(ModulePreparedNotifyFunc prepared_func, */ void gdk_pixbuf__wbmp_image_stop_load(gpointer data) { - struct bmp_progressive_state *context = - (struct bmp_progressive_state *) data; + struct wbmp_progressive_state *context = + (struct wbmp_progressive_state *) data; g_return_if_fail(context != NULL); if (context->pixbuf) @@ -147,7 +147,7 @@ void gdk_pixbuf__wbmp_image_stop_load(gpointer data) } static gboolean -getin(struct bmp_progressive_state *context, const guchar **buf, guint *buf_size, guchar *ptr, int datum_size) +getin(struct wbmp_progressive_state *context, guchar **buf, guint *buf_size, guchar *ptr, int datum_size) { int last_num, buf_num; @@ -165,10 +165,12 @@ getin(struct bmp_progressive_state *context, const guchar **buf, guint *buf_size memmove(context->last_buf, context->last_buf+last_num, context->last_len); *buf_size -= buf_num; *buf += buf_num; + + return TRUE; } static gboolean -save_rest(struct bmp_progressive_state *context, const guchar *buf, guint buf_size) +save_rest(struct wbmp_progressive_state *context, const guchar *buf, guint buf_size) { if(buf_size > (sizeof(context->last_buf) - context->last_len)) return FALSE; @@ -180,11 +182,10 @@ save_rest(struct bmp_progressive_state *context, const guchar *buf, guint buf_si } static gboolean -get_mbi(struct bmp_progressive_state *context, const guchar **buf, guint *buf_size, int *val) +get_mbi(struct wbmp_progressive_state *context, guchar **buf, guint *buf_size, int *val) { guchar intbuf[16]; int i, n; - guchar last; gboolean rv; *val = 0; @@ -221,8 +222,8 @@ get_mbi(struct bmp_progressive_state *context, const guchar **buf, guint *buf_si gboolean gdk_pixbuf__bmp_image_load_increment(gpointer data, guchar * buf, guint size) { - struct bmp_progressive_state *context = - (struct bmp_progressive_state *) data; + struct wbmp_progressive_state *context = + (struct wbmp_progressive_state *) data; gboolean bv; do @@ -273,7 +274,7 @@ gboolean gdk_pixbuf__bmp_image_load_increment(gpointer data, guchar * buf, first_row = context->cury; for( ; context->cury < context->height; context->cury++, context->curx = 0) { - for( ; context->curx < context->width, context->curx += 8) + for( ; context->curx < context->width; context->curx += 8) { guchar byte; guchar *ptr; diff --git a/gtk/gdk-pixbuf-loader.c b/gtk/gdk-pixbuf-loader.c index 63302937b9..c6ae8e2f21 100644 --- a/gtk/gdk-pixbuf-loader.c +++ b/gtk/gdk-pixbuf-loader.c @@ -399,7 +399,7 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader, if (priv->header_buf_offset >= LOADER_HEADER_SIZE) { - if (gdk_pixbuf_loader_load_module (loader) == 0) + if (gdk_pixbuf_loader_load_module (loader, NULL) == 0) return 0; } @@ -563,7 +563,7 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader) /* We have less the 128 bytes in the image. Flush it, and keep going. */ if (priv->image_module == NULL) - gdk_pixbuf_loader_load_module (loader); + gdk_pixbuf_loader_load_module (loader, NULL); if (priv->image_module && priv->image_module->stop_load) priv->image_module->stop_load (priv->context); -- 2.30.2